import Vue from 'vue'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import App from './App.vue'
import router from '@/router'
import store from './store'
import '@/style/index.scss' // global scss
import animated from 'animate.css'
import '@/assets/iconfont/iconfont.css'
import Pagination from '@/components/Pagination'
import util from '@/utils/util.js';
import permission from './directives/permission'

Vue.use(animated)
// 全局引入element-ui
Vue.use(ElementUI, { size: 'small'})


// 隐藏生产环境控制台提示信息
Vue.config.productionTip = false

// 自定义指令，用于按钮权限控制
Vue.use(permission)

// 全局引入自定义分页插件
Vue.component('Pagination', Pagination)

// 全局js方法挂载，使用方法this.$util
Vue.prototype.$util = util

// element-ui全局消息封装
Vue.prototype.msgSuccess = function (msg) {
  this.$message({
    showClose: true,
    message: msg,
    type: 'success'
  })
}
Vue.prototype.msgError = function (msg) {
  this.$message({
    showClose: true,
    message: msg,
    type: 'error'
  })
}
Vue.prototype.msgInfo = function (msg) {
  this.$message.info(msg)
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
